<template>
  <div class="navMenu">
    <!--<el-menu :default-active="activeIndex1" class="el-menu-demo" mode="horizontal" @select="handleSelect">
        <el-submenu v-for="(menu , index) in menus" v-bind:index="index + 1">
            <template slot="title">{{ menu.message }}</template>
            <el-menu-item index="1-1" v-for="item in menu.option" >{{ item.optionChoose }}</el-menu-item>
        </el-submenu>
    </el-menu>-->

    <el-row class="tac">
      <el-col :span="24">
        <el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" theme="dark">
          <el-submenu v-for="(menu , index) in menus" v-bind:index="index + 1" v-if="menu.viewShow">
            <template slot="title"><i class="el-icon-message"></i>
              {{ menu.message }}
            </template>
            <el-menu-item-group>
              <router-link v-for="(item , itemIndex) in menu.option" v-bind:to="item.path" class="path-link">
                <!-- 2级索引怎么绑定？？？ -->
                <el-menu-item v-bind:index="(index + 1) + '-' + (itemIndex + 1)">
                  {{ item.optionChoose }}
                </el-menu-item>
              </router-link>

              <!--<el-menu-item index="1-1" v-for="item in menu.option">
                  {{ item.optionChoose }}
              </el-menu-item>-->
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<style>
  .path-link {
    text-decoration: none;
    color: #bfcbd9;
  }
</style>
<script>

  export default{
    name: 'navMenu',
    data(){
      return {
        activeIndex1: '1',
        menus: [
          {
            viewShow: true,
            message: '基础信息管理',
            option: [
              {
                path: '/StudentBaseInfo',
                optionChoose: '学生基本信息'
              }, {
                path: '/ProfessionBaseInfo',
                optionChoose: '专业基本信息'
              }, {
                path: '/ClassBaseInfo',
                optionChoose: '班级基本信息'
              }, {
                path: '/TeacherBaseInfo',
                optionChoose: '教师基本信息'
              }
            ]
          },
          {
            viewShow: true,
            message: '专业培养方案管理',
            option: [
              {
                path: '/TrainProgram',
                optionChoose: '培养方案'
              }
            ]
          },
          {
            viewShow: true,
            message: '课程管理',
            option: [
              {
                path: '/TeacherCourseInfo',
                optionChoose: '教师课程表'
              }, {
                path: '/StudentCourseInfo',
                optionChoose: '学生课程表'
              },
              {
                path: '/TeachingProgramInfo',
                optionChoose: '课程教学大纲'
              },
              {
                path: '/CourseArrangement',
                optionChoose: '排课管理'
              },
              {
                path: '/CourseExamination',
                optionChoose: '排课审核'
              },
              {
                path: '/AuditSituation',
                optionChoose: '查看审核情况'
              },
              {
                path: '/CourseScheduleManage',
                optionChoose: '课程进度管理'
              },
              {
                path: '/TestProgramInfo',
                optionChoose: '课程试验大纲'
              },
              {
                path: '/TeachingDocumentManage',
                optionChoose: '教学资料管理'
              }
            ]
          },
          {
            viewShow: true,
            message: '教材管理',
            option: [
              {
                path: '/TeachMaterialDBManage',
                optionChoose: '教材库管理'
              }, {
                path: '/NewOrder',
                optionChoose: '新增订单'
              }
            ]
          },
          {
            viewShow: true,
            message: '课程设计',
            option: [
              {
                path: '/UploadCourseDesign',
                optionChoose: '上传课设安排'
              },
              {
                path: '/CheckCourseDesign',
                optionChoose: '查看课设安排'
              }
            ]
          },
          {
            viewShow: true,
            message: '毕业设计',
            option: [
              {
                path: '/PublishGraduation',
                optionChoose: '发布毕业设计安排'
              },
              {
                path: '/QueryGraduation',
                optionChoose: '查看毕业设计安排'
              },
              {
                path: '/UploadGraduation',
                optionChoose: '上传毕业设计题目'
              },
              {
                path:'/LookGraduation',
                optionChoose:'查看毕业设计题目'
              },
              {
                path:'/SelectGraduation',
                optionChoose:'学生选择毕设题目'
              },
              {
                path:'/TeacherSelect',
                optionChoose:'教师选择学生'
              }
            ]
          },
          {
            viewShow: true,
            message: '统计分析',
            option: [
              {
                path: '/TeacherWork',
                optionChoose: '教学工作量统计'
              },
              {
                path: '/TeacherWorkQuery',
                optionChoose: '教学工作量查看'
              },
              {
                path:'/TeacherInfoQuery',
                optionChoose:'教师信息查询'
              },
              {
                path: '/StudentInfoQuery',
                optionChoose: '学生信息查询'
              },
              {
                path:'/MajorPlan',
                optionChoose: '专业培养计划'
              }
            ]
          },
          {
            viewShow: true,
            message: '个人信息',
            option: [
              {
                path: '/PersonInfoManage',
                optionChoose: '个人信息'
              },
              {
                path: '/ChangePassword',
                optionChoose: '修改密码'
              }
            ]
          },
          {
            viewShow: true,
            message: '系统管理',
            option: [
              {
                path: '/CollegeInit',
                optionChoose: '学院初始化'
              },
              {
                path: '/StudentManage',
                optionChoose: '学生管理'
              },
              {
                path: '/TeacherManage',
                optionChoose: '教师管理'
              }
            ]
          }
        ]
      }
    },
    components: {},
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    }
  }
</script>
